<!DOCTYPE html><html><head><meta charset="UTF-8" />
<title>with x3.js (inlining)</title>

<script>var begin = Date.now();function say(msg) { console.log(msg + " " + (Date.now() - begin)); }</script>

<script>
var x3;
x3||function(m,h){function i(a,b,d,c){p=1E3*(c||7);q=b;n=d;try{f=new r}catch(o){f=new s}f.fetch(a,x)}function x(a,b,d){if(d)return t(d),n&&setTimeout(function(){u(a,b,function(b,o,g){b&&d!==g&&(f.add(a,o,g),n(o))})},p),l(v=!0);u(a,"",function(b,d,g){t(g);f.add(a,d,g);l()})}function u(a,b,d){var c=new XMLHttpRequest;c.onreadystatechange=function(){if(4===c.readyState)switch(c.status){case 200:case 201:return d(!0,c.getResponseHeader("Last-Modified")||"",c.responseText);case 304:return d(!1)}};c.open("GET",
a,!0);c.setRequestHeader("If-Modified-Since",b?b:"Tue, 01 Feb 2000 00:00:00 GMT");c.send(null)}function t(a){var b=h.createElement("script");(h.head||h.getElementsByTagName("head")[0]).appendChild(b);b.charset="utf-8";b.text=a}function r(){this.db=m.openDatabase(e,"1.0",e,512E3);this.db[j](function(a){a[k]("CREATE TABLE IF NOT EXISTS x3 (url TEXT PRIMARY KEY,date TEXT,src TEXT)")})}function s(){this.db=m.localStorage||{}}function l(){2===++y&&q(v)}function w(){try{(new Image).doScroll(),l()}catch(a){setTimeout(w,
64)}}var f=null,p=0,y=0,q=null,n=null,v=!1,e="x3",k="executeSql",j="transaction";m[e]=i;i.clear=function(){f.clear()};i.remove=function(a){f.remove(a)};i.reload=function(){location.reload(!0)};i.ready=function(a){for(var a=a||location+"",b=[].slice.call(arguments).slice(1),d,c;(d=b.shift())&&(c=b.shift());)if(RegExp(d).test(a))return c();d()};r.prototype={fetch:function(a,b){this.db[j](function(d){d[k]("SELECT date,src FROM x3 WHERE url=?",[a],function(d,e){var g="",f="";e.rows.length&&(g=e.rows.item(0).date,
f=e.rows.item(0).src);b(a,g,f)})})},add:function(a,b,d){function c(c){e[j](function(c){c[k]("INSERT OR REPLACE INTO x3 VALUES(?,?,?)",[a,b,d])},function(){c&&c(!0)})}var e=this.db;c(function(a){a&&setTimeout(function(){c()},1E3)})},remove:function(a){this.db[j](function(b){b[k]("DELETE FROM x3 WHERE url=?",[a])})},clear:function(){this.db[j](function(a){a[k]("DROP TABLE x3")})}};s.prototype={fetch:function(a,b){b(a,this.db[e+a+"date"]||"",this.db[e+a]||"")},add:function(a,b,d){this.remove(a);try{this.db[e+
a+"date"]=b,this.db[e+a]=d}catch(c){this.remove(a)}},remove:function(a){delete this.db[e+a+"date"];delete this.db[e+a]},clear:function(){for(var a in this.db)a.indexOf(e)||delete this.db[a]}};h.addEventListener?h.addEventListener("DOMContentLoaded",l,!1):w()}(this,this.document);


    // x3 controller
    x3("dummy.js", function(cached) {
        mm && say("JS Ready: " + (cached ? "cached" : ""));

        // Add your code here
        x3.ready("",
            /x3.debug.htm#a$/, function() { console.log("page a"); },
            /x3.debug.htm#b$/, function() { console.log("page b"); },
            /x3.debug.htm#c$/, function() { console.log("page c"); },
            /x3.debug.htm#d$/, function() { console.log("page d"); },
            function() { console.log("page other"); }
        );

    }, function(modified) { // Modified callback
        alert("App updated! " + modified);
        x3.reload(); // page reload from server
    });

    window.onerror = function(msg, file, errno) {
        console.log(msg + " " + file + " " + errno);
        x3.clear(); // force cache clear
    };

window.addEventListener && window.addEventListener("DOMContentLoaded", function() { say("DOM Ready"); }, false);
window.onload = function() { say("Window Ready"); };
</script>
</head><body>
<button onclick="x3.clear()">clear</button>

<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images0.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images1.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images2.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images3.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images4.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images5.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images6.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images7.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images8.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images9.jpg" />
<!--
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images10.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images11.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images12.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images13.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images14.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images15.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images16.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images17.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images18.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images19.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images20.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images21.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images22.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images23.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images24.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images25.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images26.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images27.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images28.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images29.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images30.jpg" />
<img src="http://x3-js.googlecode.com/svn/trunk/test/img/images31.jpg" />
 -->

</body>
</html>
